﻿using Mes.Domain.BoundedContext.Entities.Quality;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Mes.Infrastructure.Data.BoundedContext.EntityTypeConfigurations.Quality
{
    public class LastSampleNoEntityConfig : IEntityTypeConfiguration<LastSampleNo>
    {
        public void Configure(EntityTypeBuilder<LastSampleNo> builder)
        {
            builder.ToTable("last_sample_no");
            builder.HasKey(b => new { b.Sample_Name_Template, b.Sample_Name_Instance });
            builder.Property(b => b.Sample_Name_Template).IsRequired();
            builder.Property(b => b.Sample_Name_Instance).IsRequired();
            builder.Property(b => b.Current_Sample_No).IsRequired();
            builder.Property(b => b.Last_Edit_At).IsRequired();
        }
    }
}
